package br.com.ac.fatureweb.utilitary;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 
 * 
 *
 */
public final class ReportContext implements Serializable {

	private static final long serialVersionUID = 767109709304853451L;

	public static final String RELATORIO_CONTEXT = "Report_Context";

	private Map<String, Object> atributos = null;

	/**
	 * 
	 */
	public ReportContext() {
		super();
	}

	/**
	 * 
	 * @param name
	 * @return
	 */
	public Object getAttribute(final String name) {
		Object result = null;

		if (atributos != null) {
			result = atributos.get(name);
		}
		return result;
	}

	/**
	 * 
	 * @param name
	 * @param value
	 */
	public void setAttribute(final String name, final Object value) {

		if (value != null) {
			if (atributos == null) {
				atributos = new HashMap<String, Object>();
			}
			atributos.put(name, value);
		} else {
			if (atributos != null) {
				atributos.remove(name);
			}
		}
	}

}
